/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import exception.SoluzioneException;
import java.net.CookieHandler;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import javax.swing.JLabel;
import schema.Disuguaglianze;
import schema.Simbolo;

/**
 *
 * @author Antonio
 */
public class SolverSoluzione extends JPanelFutoshikiSolverModel {

    private SolverFutoshiki controllore;

    public SolverSoluzione(SolverFutoshiki controllore, List<int[][]> soluzioni, List<Simbolo> simboli) {
        super(soluzioni, simboli);
        initComponents();

        this.controllore = controllore;

        try {

            viewSol(primaSol());
            viewSimb(simboli);
            jButton2.setEnabled(true);
        } catch (SoluzioneException ex) {

            remove(jPanel1);

            JLabel avviso = new JLabel("Nessuna soluzione trovata");

            add(avviso);
            repaint();
        }
    }

    private void viewSol(int[][] matrice) {


        for (int i = 0; i < matrice.length; i++) {

            for (int j = 0; j < matrice.length; j++) {

                switch (i) {
                    case 0:

                        switch (j) {
                            case 0:

                                jLabel1.setText("" + matrice[i][j]);
                                break;
                            case 1:

                                jLabel15.setText("" + matrice[i][j]);
                                break;
                            case 2:

                                jLabel29.setText("" + matrice[i][j]);
                                break;
                            case 3:

                                jLabel43.setText("" + matrice[i][j]);
                                break;
                            case 4:

                                jLabel57.setText("" + matrice[i][j]);
                                break;
                        }
                    case 1:
                        switch (j) {
                            case 0:

                                jLabel3.setText("" + matrice[i][j]);
                                break;
                            case 1:

                                jLabel17.setText("" + matrice[i][j]);
                                break;
                            case 2:

                                jLabel31.setText("" + matrice[i][j]);
                                break;
                            case 3:

                                jLabel45.setText("" + matrice[i][j]);
                                break;
                            case 4:

                                jLabel59.setText("" + matrice[i][j]);
                                break;
                        }
                    case 2:
                        switch (j) {
                            case 0:

                                jLabel5.setText("" + matrice[i][j]);
                                break;
                            case 1:

                                jLabel19.setText("" + matrice[i][j]);
                                break;
                            case 2:

                                jLabel33.setText("" + matrice[i][j]);
                                break;
                            case 3:

                                jLabel47.setText("" + matrice[i][j]);
                                break;
                            case 4:

                                jLabel61.setText("" + matrice[i][j]);
                                break;
                        }
                    case 3:
                        switch (j) {
                            case 0:

                                jLabel7.setText("" + matrice[i][j]);
                                break;
                            case 1:

                                jLabel21.setText("" + matrice[i][j]);
                                break;
                            case 2:

                                jLabel35.setText("" + matrice[i][j]);
                                break;
                            case 3:

                                jLabel49.setText("" + matrice[i][j]);
                                break;
                            case 4:

                                jLabel63.setText("" + matrice[i][j]);
                                break;
                        }
                    case 4:
                        switch (j) {
                            case 0:

                                jLabel9.setText("" + matrice[i][j]);
                                break;
                            case 1:

                                jLabel23.setText("" + matrice[i][j]);
                                break;
                            case 2:

                                jLabel37.setText("" + matrice[i][j]);
                                break;
                            case 3:

                                jLabel51.setText("" + matrice[i][j]);
                                break;
                            case 4:

                                jLabel65.setText("" + matrice[i][j]);
                                break;
                        }

                }

            }
        }

    }// viewSol

    private void viewSimb(List<Simbolo> s) {

        for (Simbolo si : simboli) {

            switch (si.getCoordinataA().getRiga()) {

                case 0:

                    switch (si.getCoordinataA().getColonna()) {

                        case 0:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel10.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel2.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;

                        case 1:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel24.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel16.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 2:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel38.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel30.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 3:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel52.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel44.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 4:

                            jLabel58.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            break;
                    }
                    break;
                case 1:

                    switch (si.getCoordinataA().getColonna()) {

                        case 0:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel11.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel4.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;

                        case 1:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel25.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel18.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 2:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel39.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel32.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 3:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel53.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel46.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 4:

                            jLabel16.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            break;
                    }
                    break;
                case 2:

                    switch (si.getCoordinataA().getColonna()) {

                        case 0:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel12.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel6.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;

                        case 1:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel26.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel20.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 2:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel40.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel34.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 3:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel54.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel48.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 4:

                            jLabel62.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            break;
                    }
                    break;
                case 3:

                    switch (si.getCoordinataA().getColonna()) {

                        case 0:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel13.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel8.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;

                        case 1:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel27.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel22.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 2:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel41.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel36.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 3:

                            if (si.getCoordinataB().getRiga() == si.getCoordinataA().getRiga()) {

                                jLabel55.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            } else {

                                jLabel50.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");
                            }
                            break;
                        case 4:

                            jLabel64.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "v" : "^");

                            break;
                    }
                    break;
                case 4:

                    switch (si.getCoordinataA().getColonna()) {

                        case 0:

                            jLabel14.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            break;

                        case 1:

                            jLabel28.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            break;
                        case 2:

                            jLabel42.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            break;
                        case 3:

                            jLabel56.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? ">" : "<");
                            break;
                        case 4:

                            jLabel56.setText(si.getDisuguaglianza() == Disuguaglianze.GT ? "<" : ">");
                            break;
                    }
                    break;

            }
        }
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        jLabel29 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jLabel38 = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jLabel42 = new javax.swing.JLabel();
        jLabel43 = new javax.swing.JLabel();
        jLabel44 = new javax.swing.JLabel();
        jLabel45 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        jLabel47 = new javax.swing.JLabel();
        jLabel48 = new javax.swing.JLabel();
        jLabel49 = new javax.swing.JLabel();
        jLabel50 = new javax.swing.JLabel();
        jLabel51 = new javax.swing.JLabel();
        jLabel52 = new javax.swing.JLabel();
        jLabel53 = new javax.swing.JLabel();
        jLabel54 = new javax.swing.JLabel();
        jLabel55 = new javax.swing.JLabel();
        jLabel56 = new javax.swing.JLabel();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        jLabel59 = new javax.swing.JLabel();
        jLabel60 = new javax.swing.JLabel();
        jLabel61 = new javax.swing.JLabel();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        jLabel64 = new javax.swing.JLabel();
        jLabel65 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();

        setMaximumSize(new java.awt.Dimension(500, 500));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Soluzione 1"));

        jLabel1.setText(" ");

        jLabel2.setText(" ");

        jLabel3.setText(" ");

        jLabel4.setText(" ");

        jLabel5.setText(" ");

        jLabel6.setText(" ");

        jLabel7.setText(" ");

        jLabel8.setText(" ");

        jLabel9.setText(" ");

        jLabel10.setText(" ");

        jLabel11.setText(" ");

        jLabel12.setText(" ");

        jLabel13.setText(" ");

        jLabel14.setText(" ");

        jLabel15.setText(" ");

        jLabel16.setText(" ");

        jLabel17.setText(" ");

        jLabel18.setText(" ");

        jLabel19.setText(" ");

        jLabel20.setText(" ");

        jLabel21.setText(" ");

        jLabel22.setText(" ");

        jLabel23.setText(" ");

        jLabel24.setText(" ");

        jLabel25.setText(" ");

        jLabel26.setText(" ");

        jLabel27.setText(" ");

        jLabel28.setText(" ");

        jLabel29.setText(" ");

        jLabel30.setText(" ");

        jLabel31.setText(" ");

        jLabel32.setText(" ");

        jLabel33.setText(" ");

        jLabel34.setText(" ");

        jLabel35.setText(" ");

        jLabel36.setText(" ");

        jLabel37.setText(" ");

        jLabel38.setText(" ");

        jLabel39.setText(" ");

        jLabel40.setText(" ");

        jLabel41.setText(" ");

        jLabel42.setText(" ");

        jLabel43.setText(" ");

        jLabel44.setText(" ");

        jLabel45.setText(" ");

        jLabel46.setText(" ");

        jLabel47.setText(" ");

        jLabel48.setText(" ");

        jLabel49.setText(" ");

        jLabel50.setText(" ");

        jLabel51.setText(" ");

        jLabel52.setText(" ");

        jLabel53.setText(" ");

        jLabel54.setText(" ");

        jLabel55.setText(" ");

        jLabel56.setText(" ");

        jLabel57.setText(" ");

        jLabel58.setText(" ");

        jLabel59.setText(" ");

        jLabel60.setText(" ");

        jLabel61.setText(" ");

        jLabel62.setText(" ");

        jLabel63.setText(" ");

        jLabel64.setText(" ");

        jLabel65.setText(" ");

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(116, 116, 116)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel9)
                        .add(18, 18, 18)
                        .add(jLabel14))
                    .add(jLabel8)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel7)
                        .add(18, 18, 18)
                        .add(jLabel13))
                    .add(jLabel6)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel5)
                        .add(18, 18, 18)
                        .add(jLabel12))
                    .add(jLabel4)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel3)
                        .add(18, 18, 18)
                        .add(jLabel11))
                    .add(jLabel2)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel1)
                        .add(18, 18, 18)
                        .add(jLabel10)))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel23)
                    .add(jLabel22)
                    .add(jLabel21)
                    .add(jLabel20)
                    .add(jLabel19)
                    .add(jLabel18)
                    .add(jLabel17)
                    .add(jLabel16)
                    .add(jLabel15))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel28)
                    .add(jLabel27)
                    .add(jLabel26)
                    .add(jLabel25)
                    .add(jLabel24))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel37)
                    .add(jLabel36)
                    .add(jLabel35)
                    .add(jLabel34)
                    .add(jLabel33)
                    .add(jLabel32)
                    .add(jLabel31)
                    .add(jLabel30)
                    .add(jLabel29))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel42)
                    .add(jLabel41)
                    .add(jLabel40)
                    .add(jLabel39)
                    .add(jLabel38))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel51)
                    .add(jLabel50)
                    .add(jLabel49)
                    .add(jLabel48)
                    .add(jLabel47)
                    .add(jLabel46)
                    .add(jLabel45)
                    .add(jLabel44)
                    .add(jLabel43))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel56)
                    .add(jLabel55)
                    .add(jLabel54)
                    .add(jLabel53)
                    .add(jLabel52))
                .add(18, 18, 18)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel65)
                    .add(jLabel64)
                    .add(jLabel63)
                    .add(jLabel62)
                    .add(jLabel61)
                    .add(jLabel60)
                    .add(jLabel59)
                    .add(jLabel58)
                    .add(jLabel57))
                .addContainerGap(110, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(12, 12, 12)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel57)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel58)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel59)
                        .add(12, 12, 12)
                        .add(jLabel60)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel61)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel62)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel63)
                        .add(12, 12, 12)
                        .add(jLabel64)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel65))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel52)
                        .add(40, 40, 40)
                        .add(jLabel53)
                        .add(40, 40, 40)
                        .add(jLabel54)
                        .add(40, 40, 40)
                        .add(jLabel55)
                        .add(40, 40, 40)
                        .add(jLabel56))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel43)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel44)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel45)
                        .add(12, 12, 12)
                        .add(jLabel46)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel47)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel48)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel49)
                        .add(12, 12, 12)
                        .add(jLabel50)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel51))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel38)
                        .add(40, 40, 40)
                        .add(jLabel39)
                        .add(40, 40, 40)
                        .add(jLabel40)
                        .add(40, 40, 40)
                        .add(jLabel41)
                        .add(40, 40, 40)
                        .add(jLabel42))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel29)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel30)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel31)
                        .add(12, 12, 12)
                        .add(jLabel32)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel33)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel34)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel35)
                        .add(12, 12, 12)
                        .add(jLabel36)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel37))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel24)
                        .add(40, 40, 40)
                        .add(jLabel25)
                        .add(40, 40, 40)
                        .add(jLabel26)
                        .add(40, 40, 40)
                        .add(jLabel27)
                        .add(40, 40, 40)
                        .add(jLabel28))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jLabel15)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel16)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel17)
                        .add(12, 12, 12)
                        .add(jLabel18)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel19)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel20)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel21)
                        .add(12, 12, 12)
                        .add(jLabel22)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel23))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel1)
                            .add(jLabel10))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel2)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel3)
                            .add(jLabel11))
                        .add(12, 12, 12)
                        .add(jLabel4)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel5)
                            .add(jLabel12))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel6)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel7)
                            .add(jLabel13))
                        .add(12, 12, 12)
                        .add(jLabel8)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel9)
                            .add(jLabel14))))
                .addContainerGap(60, Short.MAX_VALUE))
        );

        jButton1.setText("Successiva");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Precendente");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Indietro");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jButton3)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jButton2)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jButton1)
                .addContainerGap())
            .add(layout.createSequentialGroup()
                .add(39, 39, 39)
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(0, 43, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jButton1)
                    .add(jButton2)
                    .add(jButton3))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

        try {

            viewSol(prossimaSol(jPanel1));
            jButton2.setEnabled(true);
        } catch (SoluzioneException ex) {

            jButton1.setEnabled(false);
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed

        try {

            viewSol(precedenteSol(jPanel1));
            jButton1.setEnabled(true);
        } catch (SoluzioneException ex) {

            jButton2.setEnabled(false);
        }
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed


        controllore.remove(this);
        controllore.addSchema();

    }//GEN-LAST:event_jButton3ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel54;
    private javax.swing.JLabel jLabel55;
    private javax.swing.JLabel jLabel56;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel64;
    private javax.swing.JLabel jLabel65;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}
